package com.example.kang.aidldemo;

import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.os.RemoteException;
import android.support.annotation.Nullable;
import android.util.Log;

public class MyService extends Service {
    public MyService() {
    }

    @Nullable
    @Override
    public IBinder onBind(Intent intent) {
        return binder;
    }

    ICalcAIDL.Stub binder = new ICalcAIDL.Stub() {

        @Override
        public String getName(String name) throws RemoteException {
            Log.e("<<<", "客户端传来的 " + name);
            return "小明";
        }

        @Override
        public int getAge(int age) throws RemoteException {
            Log.e("<<<", "客户端传来的 " + age);
            return 18;
        }
    };


}
